<template>
	<view class="my">
		<view class="sj">
		</view>
		<view class="tp">
			<view>
				<u-avatar size="54" :src="src"></u-avatar>
			</view>

			<view class="you">
				<view class="ss">
					<text>服务人员{{usernanme}}

					</text>
				</view>
				<text style="margin-left:2px;color:red;padding:2px;" v-if="rzflag">已认证</text>
				<text style="margin-left:2px;color:#a2a2a2;padding:2px;" v-else>未认证</text>
				<!-- <text>18532696725</text> -->
			</view>
		</view>
		<view class="qit">
			<view class="le">
				<text> 98<text style="margin-left:2px;color: #f74b58;font-size:18px;font-weight: bold;">分</text></text>
				<text>综合评分</text>
			</view>
			<view class="ri">
				<text>89 <text>%</text> </text>
				<text>好评率</text>
			</view>
		</view>

		<view class="dy">
			<u-cell-group>
				<u-cell title="我的评价" isLink url="/pages/my/myrating/myrating"></u-cell>
				<u-cell title="账户设置" isLink url="/pages/my/accountSettings/accountSettings"></u-cell>
				<u-cell title="资质申请" isLink url="/pages/my/qualificationApplication/qualificationApplication"></u-cell>
			</u-cell-group>
			<u-cell-group>
				<u-cell title="服务技能" isLink url="/pages/my/Serviceskills/Serviceskills"></u-cell>
				<u-cell title="添加好友" isLink url="/TUIKit/components/TUIContact/index"></u-cell>
				<!-- <u-cell title="接单设置" isLink url="/pages/my/Orderacceptancesettings/Orderacceptancesettings"></u-cell> -->
				<!-- <u-cell title="服务范围" isLink url="/pages/my/serviceRange/serviceRange"></u-cell> -->
			</u-cell-group>
		</view>
		<view class="tc" @click="tcdl">
			<u-button type="primary" color="#f74347" shape="circle" text="退出登录"></u-button>
		</view>
	</view>
</template>

<script>
	import {
		mapActions,
		mapGetters
	} from 'vuex';
	import {
		base_Url
	} from '../../utils/Url';

	export default {
		data() {
			return {
				src: base_Url + "/upload/defaultimg.jpg",
				usernanme: "11111111111",
				rzflag: false
			}
		},
		onShow() {
			// console.log("设置", uni.getStorageSync("shbz"));
			// this.rzflag = uni.getStorageSync("shbz")
			const aa = uni.getStorageSync("userinfo")

			this.$http.post('/qualificationReview/tjSearch', {
				userId: JSON.parse(aa).id,
			}).then(res => {
				console.log('res', res.result[0].pass);
				this.rzflag = res.result[0].pass
			})
		},
		onLoad() {


			// uni.getStorageSync('token')
			// console.log("个人信息", JSON.parse(uni.getStorageSync('userinfo')));
			if (uni.getStorageSync('userinfo')) {
				this.usernanme = JSON.parse(uni.getStorageSync('userinfo')).phone
			}

		},
		methods: {
			...mapActions(['Login', 'GetuserInfo', 'Logout']),
			tcdl() {
				const {
					Logout
				} = this
				Logout().then(res => {
					console.log("res.", res);
					if (res.code == 200) {
						uni.redirectTo({
							url: "/pages/login/login"
						})
					}
				})

				// this.$http.get('/employees/logout').then(res => {
				// 	console.log('res', res);
				// 	if (res.code == 200) {
				// 		uni.redirectTo({
				// 			url: "/pages/login/login"
				// 		})

				// 	}
				// })

			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f5f5f5;
	}

	.my {
		position: relative;

		.sj {
			position: absolute;
			width: 100%;
			height: 200px;
			background: linear-gradient(to bottom, #85d1cf, #efffff);
			z-index: -1;

		}

		.tp {
			position: absolute;
			top: 25px;
			left: 40px;
			display: flex;

			.you {
				margin-left: 8px;
			}
		}

		.qit {
			width: 100%;
			height: 120px;
			border-radius: 5px 5px 0px 0px;
			background: #ffffff;
			position: absolute;
			top: 90px;
			z-index: 900;
			display: flex;
			justify-content: space-around;


			.le {
				margin-top: 35px;
				display: flex;
				flex-direction: column;
				align-items: center;
			}

			.ri {
				margin-top: 35px;
				display: flex;
				flex-direction: column;
				align-items: center;
			}
		}

		.dy {
			width: 100%;
			position: absolute;
			top: 220px;
			z-index: 900;
		}

		.tc {
			width: 100%;
			position: absolute;
			top: 480px;
			z-index: 900;
		}
	}
</style>